import os
path = 'C:/maishu/images'
for file in os.listdir(path):
    print(file)

for file in os.listdir(path):
    full_path = os.path.abspath(file)
    if os.path.isdir(file):
        print(f'文件夹：{full_path}')
    else:
        if file.endswith(('.jpg', '.jpeg', '.png', '.gif')):
            print(f'图片：{full_path}')
        else:
            print(f'其他：{full_path}')

for dirname, subdirlist, filelist in os.walk(path):
    print(f'==={dirname}===')
    
for dirname, subdirlist, filelist in os.walk(path):
    print(f'==={dirname}===')
    print('--文件')
    for f in filelist:
        print(f'    {f}')
    print('--子文件夹')
    for d in subdirlist:
        print(f'    {d}')